package com.chc.web.house_list.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chc.web.house_list.entity.HouseList;
import com.chc.web.house_list.entity.ListParm;
import com.chc.web.house_list.mapper.HouseListMapper;
import com.chc.web.house_list.service.HouseListService;
import org.springframework.stereotype.Service;
import sun.awt.SunGraphicsCallback;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/01/13/10:42
 * @Description:
 */
@Service
public class HouseListServiceImpl extends ServiceImpl<HouseListMapper, HouseList> implements HouseListService {

    @Override
    public IPage<HouseList> getList(ListParm parm) {
        //构造分页对象
        IPage<HouseList> page = new Page<>();
        page.setCurrent(parm.getCurrentPage());
        page.setSize(parm.getPageSize());
        return this.baseMapper.getList(page,parm.getBuildNme(),parm.getUnitName(),parm.getHouseNum(),parm.getStatus());
    }

    @Override
    public List<HouseList> getHouseList() {
        return this.baseMapper.getHouseList();
    }
}
